package com.lone.demo.singleton;

public class SingletonTest03 {
    public static void main(String[] args) {
        Singleton3 instance1 = Singleton3.getInstance();
        Singleton3 instance2 = Singleton3.getInstance();
        System.out.println(instance1 == instance2);
    }
}

class Singleton3 {
    private Singleton3() { }

    private static class SingletonInstance {
        private static final Singleton3 INSTANCE = new Singleton3();
    }

    public static Singleton3 getInstance() {
        return SingletonInstance.INSTANCE;
    }
}